package com.bolang.onlycode.demo.ThreadPool;

import com.bolang.onlycode.demo.Future.RunnableTest;
import sun.misc.Unsafe;

import java.lang.reflect.Field;
import java.util.Timer;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;

public class ThreadPoolTest {
    static LinkedBlockingQueue<Integer> objects = new LinkedBlockingQueue<Integer>();
    public static void main(String[] args) throws InterruptedException, NoSuchFieldException, IllegalAccessException {
//        ExecutorService executorService = new ThreadPoolExecutor(0, Integer.MAX_VALUE,
//                60L, TimeUnit.SECONDS,
//                new SynchronousQueue<Runnable>(true));
        ExecutorService executorService = Executors.newSingleThreadExecutor();
        Runnable run = new RunnableTest();
        executorService.execute(run);

        AtomicInteger count = new AtomicInteger(5);
        System.out.println(count.getAndIncrement());
        System.out.println(count);



    }
}
